﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Xml.Linq;

namespace OpenMVCRM.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {

            //string[] items= new string[] { "vacant","reserved","reserved","reserved","vacant"};

            //List<int> vacantIndices=new List<int>();
            //List<int> reservedIndices=new List<int>();
            //int indexCounter=0;
            //foreach (string item in items)
            //{
            //    if (item == "vacant")
            //        vacantIndices.Add(indexCounter);
            //    else if (item == "reserved")
            //        reservedIndices.Add(indexCounter);

            //    indexCounter++;
            //}

            //string vacantIndexs = String.Join(",", vacantIndices);

            string items = "1,4,6,3";

            XElement elm = new XElement("foo");
            foreach (var item in items.Split(','))
            {
                elm.Add(new XElement("id", item));
            }



            return View();
        }


    }
}
